const fs = require("fs");
let config = {};
const filePath = __dirname + "/../../../config/";
if (fs.existsSync(filePath + "config.default.ts")) {
  const tmp = require(filePath + "config.default.ts");
  config = tmp;
}
if (process.env.npm_lifecycle_event == "dev") {
  if (fs.existsSync(filePath + "config.local.ts")) {
    const tmp = require(filePath + "config.local.ts");
    config = { ...config, ...tmp };
  }
}
if (process.env.npm_lifecycle_event == "start") {
  if (fs.existsSync(filePath + "config.prod.ts")) {
    const tmp = require(filePath + "config.prod.ts");
    config = { ...config, ...tmp };
  }
}
module.exports = config;
